import java.util.*;

public class Hashset {
    public static void main(String[] args) {
        Map<Object, Object> map = new HashMap<Object, Object>();

        Set set = new HashSet();
        set.add("haha");
        set.add("xixi");
        set.add("ssu");

/*        for (Object o : set) {
            if (o.equals("haha")){
                set.add("hads");
            }
        }

        System.out.println(set);*/

        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(20);
        arrayList.add(2);
        arrayList.add(3);

        System.out.println(arrayList);

        Iterator<Integer> iterator = arrayList.iterator();
        while (iterator.hasNext()){
            if (iterator.next()==2){
                iterator.remove();
            }


        }
        System.out.println(arrayList);
    }
}
